<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	template="/WEB-INF/templates/layoutCourtier.xhtml">

	<ui:define name="title"> 
		#{msgs.titrePanelPrincipal}
	</ui:define>

	<ui:define name="content">
	<h:form>
	<p:commandButton image="ui-icon ui-icon-star" immediate="true"
	style="width:120px" value="#{msgs.accueil}" action="versaccueil" ajax="false" />
	</h:form>
	<p:panel header="#{msgs.titrePanelPrincipal}" style="width:1200px;height:800px;">
	<h:outputText value="#{msgs.identification}:" />
	
	<p:separator id="customSeparator" style="width:600px;height:10px" />
		<h:form id="login" prependId="false"
			onsubmit="document.#{p:component('login')}.action='j_security_check';">
			<h:panelGrid id="loginGrid" columns="3">
				<h:outputText for="j_username" value="${msgs.nomutilisateur}: " />
				<p:inputText  id="j_username" required="true">
					<f:validateLength minimum="4" />
					<f:validateRequired />
					<p:ajax event="blur" update="msgj_username" />
				</p:inputText>
				<h:message id="msgj_username" for="j_username" />

				<h:outputText for="j_password" value="${msgs.motdepasse}: " />
				<p:password id="j_password" required="true">
					<f:validateLength minimum="4" />
					<f:validateRequired />
					<p:ajax event="blur" update="msgj_password" />
				</p:password>
				<h:message id="msgj_password" for="j_password" />


				<p:commandButton onclick="document.#{component.clientId}.action='j_security_check';" value="${msgs.login}"/>

			</h:panelGrid>
		</h:form>
		<p:separator id="customSeparator1" style="width:600px;height:10px" />
		</p:panel>
		<script>
   			$('#j_password input').attr('name', 'j_password');
		</script>
	</ui:define>
	
</ui:composition>